/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.herenit.beijing.dh2011.security.entity;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Obama
 */
@Entity
@Table(name = "SECURITY_OPERATION")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "SecurityOperation.findAll", query = "SELECT s FROM SecurityOperation s"),
    @NamedQuery(name = "SecurityOperation.findByOperationId", query = "SELECT s FROM SecurityOperation s WHERE s.operationId = :operationId"),
    @NamedQuery(name = "SecurityOperation.findByOperationName", query = "SELECT s FROM SecurityOperation s WHERE s.operationName = :operationName"),
    @NamedQuery(name = "SecurityOperation.findByOperationCode", query = "SELECT s FROM SecurityOperation s WHERE s.operationCode = :operationCode"),
    @NamedQuery(name = "SecurityOperation.findByOperationDesc", query = "SELECT s FROM SecurityOperation s WHERE s.operationDesc = :operationDesc")})
public class SecurityOperation implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 32)
    @Column(name = "OPERATION_ID")
    private String operationId;
    @Size(max = 30)
    @Column(name = "OPERATION_NAME")
    private String operationName;
    @Size(max = 60)
    @Column(name = "OPERATION_CODE")
    private String operationCode;
    @Size(max = 200)
    @Column(name = "OPERATION_DESC")
    private String operationDesc;

    public SecurityOperation() {
    }

    public SecurityOperation(String operationId) {
        this.operationId = operationId;
    }

    public String getOperationId() {
        return operationId;
    }

    public void setOperationId(String operationId) {
        this.operationId = operationId;
    }

    public String getOperationName() {
        return operationName;
    }

    public void setOperationName(String operationName) {
        this.operationName = operationName;
    }

    public String getOperationCode() {
        return operationCode;
    }

    public void setOperationCode(String operationCode) {
        this.operationCode = operationCode;
    }

    public String getOperationDesc() {
        return operationDesc;
    }

    public void setOperationDesc(String operationDesc) {
        this.operationDesc = operationDesc;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (operationId != null ? operationId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SecurityOperation)) {
            return false;
        }
        SecurityOperation other = (SecurityOperation) object;
        if ((this.operationId == null && other.operationId != null) || (this.operationId != null && !this.operationId.equals(other.operationId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.herenit.beijing.dh2011.security.SecurityOperation[ operationId=" + operationId + " ]";
    }
    
}
